using UnityEngine;
using UnityEngine.UI;
using TMPro;

namespace Game.UI {
	public sealed class DisconnectedWindow : MonoBehaviour {
		public Button CloseButton;
		public Button OkButton;
		public TMP_Text MessageText;

		public void Show(string message) {
			gameObject.SetActive(true);
			MessageText.text = message;
			OkButton.onClick.RemoveAllListeners();
			OkButton.onClick.AddListener(OnCloseClick);
			CloseButton.onClick.RemoveAllListeners();
			CloseButton.onClick.AddListener(OnCloseClick);
		}

		void OnCloseClick() {
			gameObject.SetActive(false);
		}
	}
}

